package com.example.project;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class PlanetDescFragment extends Fragment {
	int mNowIndex;

	public static PlanetDescFragment newInstance(int index) {
		PlanetDescFragment df = new PlanetDescFragment();
		df.mNowIndex = index;
		return df;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		String[] planetDescs = getResources()
				.getStringArray(R.array.PLANETDESC);
		View root = inflater.inflate(R.layout.descfragment,
				container, false);
		TextView text = (TextView) root
				.findViewById(R.id.descfragment_txtdescription);
		text.setText(planetDescs[mNowIndex]);
		return root;
	}
}